# Recipe file for allegro.
#
# Maintainers: (C) 2016,2017 Mateus P. Rodrigues, mprodrigues@dragora.org.
#
# Under the terms of the GNU General Public License.

program=allegro
version=5.2.3.0
release=1

description="
Allegro is a cross-platform library mainly aimed at video game and
multimedia programming. It handles common, low-level tasks such as
creating windows, accepting user input, loading data, drawing images,
playing sounds, etc. and generally abstracting away the underlying
platform. However, Allegro is not a game engine: you are free to
design and structure your program as you like.
"

homepage=http://liballeg.org/
license=zlib

tarname=${program}-${version}.tar.gz

# Remote source(s)
fetch="http://github.com/liballeg/allegro5/releases/download/${version}/$tarname"

# Source documentation
docs="CHANGES* CONTRIBUTORS.txt LICENSE.txt README*"
docsdir="${docdir}/${program}-${version}"

build() {
    unpack "${tardir}/$tarname"

    cd "$srcdir"
    mkdir -p build && cd build
    cmake -DCMAKE_INSTALL_PREFIX=/usr ..

    make -j${jobs}
    make -j${jobs} install DESTDIR="$destdir"

    cd ..

    # Copy documentation
    mkdir -p "${destdir}${docsdir}"
    cp -p $docs "${destdir}${docsdir}"
}
